package com.za.wbw.web.wap.action;

import java.util.HashMap;
import java.util.Map;

import com.za.wbw.model.wap.OrderInfo;
import com.za.wbw.service.wap.OrderProductService;
import com.za.wbw.service.wap.OrderService;
import com.za.wbw.service.wap.PaymentService;
import com.za.wbw.util.BaseAction;

public class OrderAction  extends BaseAction {
	private static final long serialVersionUID = 1L;
	
	private OrderService orderService;
	private OrderProductService orderProductService;
	private PaymentService paymentService;
	
	public String saveOrder() throws Exception{
		OrderInfo order = new OrderInfo();
		order = this.getOrderService().saveOrder(order);
		this.getPaymentService().savePayment(null);
		this.getOrderProductService().saveOrderProduct(null);
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("code", order.getCode());
		outPrint(map);
		return null;
	}

	public OrderService getOrderService() {
		return orderService;
	}

	public void setOrderService(OrderService orderService) {
		this.orderService = orderService;
	}

	public OrderProductService getOrderProductService() {
		return orderProductService;
	}

	public void setOrderProductService(OrderProductService orderProductService) {
		this.orderProductService = orderProductService;
	}

	public PaymentService getPaymentService() {
		return paymentService;
	}

	public void setPaymentService(PaymentService paymentService) {
		this.paymentService = paymentService;
	}
	
}
